import http from "@/api";

/**
 * 专题列表
 */
export const specialListApi = (params: object) => {
    return http.get(`/special/list`, params);
};

/**
 * 专题分页列表
 */
export const specialPageListApi = (params: object) => {
    return http.get(`/special/paging`, params);
};

/**
 * 专题关联文章列表
 */
export const specialAssocListApi = (params: object) => {
    return http.get(`/special/assoc/list`, params);
};

/**
 * 保存关联文章
 * @param params
 */
export const saveAssocListApi = (params: object) => {
    return http.post(`/special/assoc`, params);
}

/**
 * 修改关联文章排序
 * @param params
 */
export const changeAssocSortApi = (params: object) => {
    return http.post(`/special/assoc/change_sort`, params);
};

/**
 * 删除关联文章
 * @param params
 */
export const deleteAssocListApi = (params: object) => {
    return http.delete(`/special/assoc/delete`, params);
}

/**
 * 新增专题
 * @param params
 */
export const addSpecialApi = (params: object) => {
    return http.post(`/special/add`, params);
};

/**
 * 编辑专题
 * @param params
 */
export const editSpecialApi = (params: any) => {
    return http.put(`/special/edit/${params.id}`, params);
};

/**
 * 切换专题状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/special/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/special/change_sort`, params);
};

/**
 * 删除专题
 * @param id
 */
export const deleteSpecialByIdApi = (id: number) => {
    return http.delete(`/special/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteSpecialApi = (params: object) => {
    return http.post(`/special/delete`, params);
};
